/*
* ============================================================================
*  Name        : example_009.h
*  Part of     : Finite state machine examples
*  Description : Class definition
*  Version     : %version: %
*  
*
* ============================================================================
*/
#if !defined(  __sm_example_009_h__ )
#define __sm_example_009_h__

#include <sea_statemachine>

using namespace sea;

/**
 * @file example_009.h
 * @brief User input processing. Pressing Right and Left arrow key moves the <br>
 * 'snake'. Esc finishes the state machine
 *
 * @ingroup StateMachineExamples
 *
 */
namespace sea_examples
{
    /**
     * @class Snake
     * @brief \b Examples: Demonstrates inter-state machine communication
     *
     * @ingroup StateMachineExamples
     */
    class Snake : public StateMachine
    {
    public:
        Snake( int aPosition = 0 );

        EVENT_EXT( Snake, Ev_Ext_Key );
    private:
        EVENT_INT( Snake, Ev_Int_MoveLeft );
        EVENT_INT( Snake, Ev_Int_MoveRight );

        ACT( Snake, check_input );
        ACT( Snake, move_right );
        ACT( Snake, move_left );
        ACT( Snake, draw );
    private:
        int m_position;
    };

    void launch_example_009( );
}

#endif
